package tictactoe.clientprocessors;

import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Test;
import tictactoe.Client;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Double
 * Date: 16.01.12
 * Time: 4:52
 * To change this template use File | Settings | File Templates.
 */
public class MultiClientProcessorTest extends TestCase
{
	private MultiClientProcessor mcP = new MultiClientProcessor();
	private Client client = new Client();
	@Test
	public void testAddClient() throws Exception
	{
		client.setName("Misha");
		mcP.addClient(client);
		Assert.assertEquals(1,mcP.getPreAuthClient().size());

	}

	@Test
	public void testRemoveClient() throws Exception
	{
		mcP.getClients().add(client);
		Assert.assertTrue(mcP.getClients().contains(client));
		mcP.removeClient(client);
		Assert.assertFalse(mcP.getClients().contains(client));
	}

	@Test
	public void testGetClients() throws Exception
	{   
		if(mcP.getClients() instanceof ArrayList)
		Assert.assertTrue(true);

	}


}
